******SET YOUR DIRECTORY to ...\replication




clear all

******************************************************************
***City center place
******************************************************************
***City center place
clear all
set more off

use intermediatedata\data_ucr_ori, clear

keep fipsplace_00 FMSA city_center
duplicates drop fipsplace_00, force

drop if FMSA==.

save rawdata\census_tract70\msa_place_cc.dta, replace


******************************************************************
***Intersection 1970 census tract and 2000 place maps
clear all
import excel using rawdata\census_tract70\nhgis0016_shapefile_tl2000_us_tract_1970\tract_place_geom.xlsx, clear first

*Assign one tract to one place
egen area_tract=total(area), by(GISJOIN)
gen prop_area_tract=area/area_tract
egen rank_prop_area_tract=rank(prop_area_tract), by(GISJOIN) field
keep if rank_prop_area_tract==1

keep PLCIDFP00 GISJOIN
destring PLCIDFP00, gen(fipsplace_00) force

*Merge with CC data
merge m:1 fipsplace_00 using rawdata\census_tract70\msa_place_cc.dta

*Lose all cities that were not a SMSA in 1970 (63 very small cities) or places in tracts that were not considered part of SMSA in 1970
drop if _merge==2
drop _merge


tempfile tractplacecc
save `tractplacecc'

******************************************************************
***School district data
*Open dictionary file
infile using "cleaning\schooldis_dict.dct", clear

*Drop observations not in SMSA or without tract information
drop if smsa_code==.
drop if tract_code==.

*Generate GISJOIN to merge it with 1970 census tract map

gen GISJOIN_state="0"+string(state_code_70)+"0" if state_code_70<10
replace GISJOIN_state=string(state_code_70)+"0" if state_code_70>=10

gen GISJOIN_county="00"+string(county_code_70)+"0" if county_code_70<10
replace GISJOIN_county="0"+string(county_code_70)+"0" if county_code_70<100 & county_code_70>=10
replace GISJOIN_county=string(county_code_70)+"0" if county_code_70>=100

gen GISJOIN_tract="000"+string(tract_code)+"0"+string(tract_suffix_code) ///
				  if tract_code<10 & tract_suffix_code<10 & tract_suffix_code!=.
replace GISJOIN_tract="000"+string(tract_code)+string(tract_suffix_code) ///
				  if tract_code<10 & tract_suffix_code>=10 & tract_suffix_code!=.
replace GISJOIN_tract="000"+string(tract_code) ///
				  if tract_code<10 & tract_suffix_code>=10 & tract_suffix_code==.
replace GISJOIN_tract="00"+string(tract_code)+"0"+string(tract_suffix_code) ///
				  if tract_code<100 & tract_code>=10 & tract_suffix_code<10 & tract_suffix_code!=.
replace GISJOIN_tract="00"+string(tract_code)+string(tract_suffix_code) ///
				  if tract_code<100 & tract_code>=10 & tract_suffix_code>=10 & tract_suffix_code!=.
replace GISJOIN_tract="00"+string(tract_code) ///
				  if tract_code<100 & tract_code>=10 & tract_suffix_code==.
replace GISJOIN_tract="0"+string(tract_code)+"0"+string(tract_suffix_code) ///
				  if tract_code<1000 & tract_code>=100 & tract_suffix_code<10 & tract_suffix_code!=.
replace GISJOIN_tract="0"+string(tract_code)+string(tract_suffix_code) ///
				  if tract_code<1000 & tract_code>=100 & tract_suffix_code>=10 & tract_suffix_code!=.
replace GISJOIN_tract="0"+string(tract_code) ///
				  if tract_code<1000 & tract_code>=100 & tract_suffix_code==.
replace GISJOIN_tract=string(tract_code)+"0"+string(tract_suffix_code) ///
				  if tract_code>=1000 & tract_suffix_code<10 & tract_suffix_code!=.
replace GISJOIN_tract=string(tract_code)+string(tract_suffix_code) ///
				  if tract_code>=1000 & tract_suffix_code>=10 & tract_suffix_code!=.
replace GISJOIN_tract=string(tract_code) ///
				  if tract_code>=1000 & tract_suffix_code==.				  
				  
gen GISJOIN="G"+GISJOIN_state+GISJOIN_county+GISJOIN_tract

*Maintain one tract-school district information
egen seq=seq(), by(GISJOIN schooldis_code)
keep if seq==1
keep GISJOIN schooldis_code

merge m:1 GISJOIN using `tractplacecc'

*Lose information from cities with no school district info
drop if _merge==1
drop if _merge==2
drop _merge

*Drop observations not in cities for our place database
drop if FMSA==.
drop if city_center==.

*Keep one place-school district observation
duplicates drop schooldis_code fipsplace_00, force

*Drop school districts without code
drop if schooldis_code==99999

sort FMSA schooldis_code
bysort FMSA schooldis_code: egen sd_ccncc=max(city_center)
egen prop_sd_ccncc=mean(sd_ccncc), by(fipsplace_00)
egen max_sd_ccncc=max(sd_ccncc), by(fipsplace_00)

label var max_sd_ccncc "NCC sharing at least one school district with CC"
label var prop_sd_ccncc "Proportion of NCC school districts shared with CC"

drop schooldis_code GISJOIN PLCIDFP00 sd_ccncc

*Keep one info at school distric level
duplicates drop fipsplace_00, force

keep fipsplace_00 prop_sd_ccncc max_sd_ccncc

save rawdata\schooldistrict\data_schooldistrict.dta, replace



///////////////////////////////////////////////////////////////////////////////////////////
///Population data
clear all


///////////////////////////////////////////////////////////////////////////////////////////
///Collapse data at place-year level///////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
use intermediatedata\data_ucr_ori, clear
drop *_cty_*

///Drop observations not inside any MSA, 418589/868611
drop if FMSA==.
///Drop observations inside MSA without city center, observation with missing: 42571/450022, observations with 0: 3532/450022
egen msawithcc=max(city_center), by(FMSA)
drop if msawithcc==0

///Merge with school district data
drop _merge
merge m:1 fipsplace_00 using rawdata\schooldistrict\data_schooldistrict.dta
*Drop observations not with school district data, or school districts unmatched
drop if _merge!=3
drop _merge


///Aggregate data for rest of the city which is not the center
*Sum population in jurisdiction of ori at MSA level for non center
egen tot_ncc_oripop1_2=total(pop1) if city_center==0, by(FMSA year)  missing
egen tot_ncc_oripop1=max(tot_ncc_oripop1_2), by(FMSA year) 
egen tot_ncc_oripop_2=total(pop) if city_center==0, by(FMSA year)  missing
egen tot_ncc_oripop=max(tot_ncc_oripop_2), by(FMSA year) 
egen tot_ncc_oripop_corr_2=total(pop_corr) if city_center==0, by(FMSA year)  missing
egen tot_ncc_oripop_corr=max(tot_ncc_oripop_corr_2), by(FMSA year) 
drop tot_ncc_oripop1_2 tot_ncc_oripop_2 tot_ncc_oripop_corr_2
*Sum population in NCC according to sharing of school district
egen tot_ncc_sdcc_oripop_corr_2=total(pop_corr) if city_center==0 & max_sd_ccncc==1, by(FMSA year)  missing
egen tot_ncc_sdcc_oripop_corr=max(tot_ncc_sdcc_oripop_corr_2), by(FMSA year) 
egen tot_ncc_nosdcc_oripop_corr_2=total(pop_corr) if city_center==0 & max_sd_ccncc==0, by(FMSA year)  missing
egen tot_ncc_nosdcc_oripop_corr=max(tot_ncc_nosdcc_oripop_corr_2), by(FMSA year) 
egen tot_ncc_allsdcc_oripop_corr_2=total(pop_corr) if city_center==0 & max_sd_ccncc==1 & prop_sd_ccncc==1, by(FMSA year)  missing
egen tot_ncc_allsdcc_oripop_corr=max(tot_ncc_allsdcc_oripop_corr_2), by(FMSA year) 

*Sum every crime at MSA level for non center
forvalues i=1/26{
egen totn_ncc_offensesunf_`i'c_2=total(totn_offensesunf_`i'c) if city_center==0, by(FMSA year)  missing
egen totn_ncc_offensesunf_`i'c=max(totn_ncc_offensesunf_`i'c_2), by(FMSA year)
gen totnpc_ncc_offensesunf_`i'c=totn_ncc_offensesunf_`i'c/tot_ncc_oripop
gen totnpcc_ncc_offensesunf_`i'c=totn_ncc_offensesunf_`i'c/tot_ncc_oripop_corr
egen totn_ncc_offenses_`i'c_2=total(totn_offenses_`i'c) if city_center==0, by(FMSA year)  missing
egen totn_ncc_offenses_`i'c=max(totn_ncc_offenses_`i'c_2), by(FMSA year)
gen totnpc_ncc_offenses_`i'c=totn_ncc_offenses_`i'c/tot_ncc_oripop
gen totnpcc_ncc_offenses_`i'c=totn_ncc_offenses_`i'c/tot_ncc_oripop_corr
egen totn_ncc_clearances_`i'c_2=total(totn_clearances_`i'c) if city_center==0, by(FMSA year)  missing
egen totn_ncc_clearances_`i'c=max(totn_ncc_clearances_`i'c_2), by(FMSA year)
gen totnpc_ncc_clearances_`i'c=totn_ncc_clearances_`i'c/tot_ncc_oripop
gen totnpcc_ncc_clearances_`i'c=totn_ncc_clearances_`i'c/tot_ncc_oripop_corr
egen totn_ncc_clearancesu18_`i'c_2=total(totn_clearancesu18_`i'c) if city_center==0, by(FMSA year)  missing
egen totn_ncc_clearancesu18_`i'c=max(totn_ncc_clearancesu18_`i'c_2), by(FMSA year)
gen totnpc_ncc_clearancesu18_`i'c=totn_ncc_clearancesu18_`i'c/tot_ncc_oripop
gen totnpcc_ncc_clearancesu18_`i'c=totn_ncc_clearancesu18_`i'c/tot_ncc_oripop_corr
drop totn_ncc_offensesunf_`i'c_2 totn_ncc_offenses_`i'c_2 totn_ncc_clearances_`i'c_2 totn_ncc_clearancesu18_`i'c_2
}
///Keep only observations of place which is city center and it is municipal jurisdiction crime, keep 300 places (16459 observations)
replace AGENTYPE=3 if ori=="OHCIP00" | ori=="NV00201" | ori=="INIPD00"
drop if city_center==.
drop if AGENTYPE==.
drop if city_center!=1 
drop if AGENTYPE!=3
///Create variable for city center
rename pop1 tot_cc_oripop1
rename pop tot_cc_oripop
rename pop_corr tot_cc_oripop_corr
forvalues i=1/26{
rename totn_offensesunf_`i'c totn_cc_offensesunf_`i'c_2
gen totnpc_cc_offensesunf_`i'c=totn_cc_offensesunf_`i'c/tot_cc_oripop
gen totnpcc_cc_offensesunf_`i'c=totn_cc_offensesunf_`i'c/tot_cc_oripop_corr
rename totn_offenses_`i'c totn_cc_offenses_`i'c
gen totnpc_cc_offenses_`i'c=totn_cc_offenses_`i'c/tot_cc_oripop
gen totnpcc_cc_offenses_`i'c=totn_cc_offenses_`i'c/tot_cc_oripop_corr
rename totn_clearances_`i'c totn_cc_clearances_`i'c
gen totnpc_cc_clearances_`i'c=totn_cc_clearances_`i'c/tot_cc_oripop
gen totnpcc_cc_clearances_`i'c=totn_cc_clearances_`i'c/tot_cc_oripop_corr
rename totn_clearancesu18_`i'c totn_cc_clearancesu18_`i'c
gen totnpc_cc_clearancesu18_`i'c=totn_cc_clearancesu18_`i'c/tot_cc_oripop
gen totnpcc_cc_clearancesu18_`i'c=totn_cc_clearancesu18_`i'c/tot_cc_oripop_corr
}
///Create Violent crimes
*Not center
egen totn_ncc_offenses_ass=rowtotal(totn_ncc_offenses_12c totn_ncc_offenses_13c totn_ncc_offenses_14c totn_ncc_offenses_15c) if year>=1964,  missing
gen totnpc_ncc_offenses_ass=totn_ncc_offenses_ass/tot_ncc_oripop if year>=1964
gen totnpcc_ncc_offenses_ass=totn_ncc_offenses_ass/tot_ncc_oripop_corr if year>=1964
egen totn_ncc_offenses_vc=rowtotal(totn_ncc_offenses_1c totn_ncc_offenses_3c totn_ncc_offenses_6c totn_ncc_offenses_11c),  missing
replace totn_ncc_offenses_vc=totn_ncc_offenses_vc-totn_ncc_offenses_16c if year>1973
replace totn_ncc_offenses_vc=totn_ncc_offenses_vc+totn_ncc_offenses_16c if year>=1977 & year<=1993 & FMSA==5600
gen totnpc_ncc_offenses_vc=totn_ncc_offenses_vc/tot_ncc_oripop
gen totnpcc_ncc_offenses_vc=totn_ncc_offenses_vc/tot_ncc_oripop_corr
*Center
egen totn_cc_offenses_ass=rowtotal(totn_cc_offenses_12c totn_cc_offenses_13c totn_cc_offenses_14c totn_cc_offenses_15c) if year>=1964,  missing
gen totnpc_cc_offenses_ass=totn_cc_offenses_ass/tot_cc_oripop if year>=1964
gen totnpcc_cc_offenses_ass=totn_cc_offenses_ass/tot_cc_oripop_corr if year>=1964
egen totn_cc_offenses_vc=rowtotal(totn_cc_offenses_1c totn_cc_offenses_3c totn_cc_offenses_6c totn_cc_offenses_11c),  missing
replace totn_cc_offenses_vc=totn_cc_offenses_vc-totn_cc_offenses_16c if year>1973
replace totn_cc_offenses_vc=totn_cc_offenses_vc+totn_cc_offenses_16c if year>=1977 & year<=1993 & ori=="NY03030"
gen totnpc_cc_offenses_vc=totn_cc_offenses_vc/tot_cc_oripop
gen totnpcc_cc_offenses_vc=totn_cc_offenses_vc/tot_cc_oripop_corr

///Illinois, not rape data between 1985 and 2012 (do not care in violent crime aggregated because rape is small)
drop state
gen state=int(fipsplace_00/100000)
foreach var of varlist tot*_3c tot*_4c tot*_5c{
replace `var'=. if year>=1985 & year<2013 & state==17
}
drop state

///Label variable
label var totn_ncc_offenses_1c "ACT NUM MURDER, MSA not central city"
label var totn_ncc_offenses_2c "ACT NUM MANSLGHTR, MSA not central city"
label var totn_ncc_offenses_3c "ACT NUM RAPE TOTL, MSA not central city"
label var totn_ncc_offenses_4c "ACT NUM FORC RAPE, MSA not central city"
label var totn_ncc_offenses_5c "ACT NUM ATMPTD RAPE, MSA not central city"
label var totn_ncc_offenses_6c "ACT NUM ROBBRY TOTL, MSA not central city"
label var totn_ncc_offenses_7c "ACT NUM GUN ROBBERY, MSA not central city"
label var totn_ncc_offenses_8c "ACT NUM KNIFE ROBRY, MSA not central city"
label var totn_ncc_offenses_9c "ACT NUM OTH WPN ROB, MSA not central city"
label var totn_ncc_offenses_10c "ACT NUM STR ARM ROB, MSA not central city"
label var totn_ncc_offenses_11c "ACT NUM ASSLT TOTAL, MSA not central city"
label var totn_ncc_offenses_12c "ACT NUM GUN ASSAULT, MSA not central city"
label var totn_ncc_offenses_13c "ACT NUM KNIFE ASSLT, MSA not central city"
label var totn_ncc_offenses_14c "ACT # OTH WPN ASSLT, MSA not central city"
label var totn_ncc_offenses_15c "ACT # HND/FEET ASLT, MSA not central city"
label var totn_ncc_offenses_16c "ACT NUM # SIMPLE ASSLT, MSA not central city"
label var totn_ncc_offenses_17c "ACT NUM # BURGLARY TOTL, MSA not central city"
label var totn_ncc_offenses_18c "ACT NUM # FORCE ENTRY, MSA not central city"
label var totn_ncc_offenses_19c "ACT NUM # ENTRY-NO FORC, MSA not central city"
label var totn_ncc_offenses_20c "ACT NUM # ATT BURGLARY, MSA not central city"
label var totn_ncc_offenses_21c "ACT NUM # LARCENY TOTAL, MSA not central city"
label var totn_ncc_offenses_22c "ACT NUM # VHC THEFT TOT, MSA not central city"
label var totn_ncc_offenses_23c "ACT NUM # AUTO THEFT, MSA not central city"
label var totn_ncc_offenses_24c "ACT NUM # TRCK/BUS THFT, MSA not central city"
label var totn_ncc_offenses_25c "ACT NUM # OTH VHC THEFT, MSA not central city"
label var totn_ncc_offenses_26c "ACT NUM # ALL FIELDS, MSA not central city"
label var totn_ncc_offenses_ass "ACT NUM # AGGRAVATED ASSAULT, MSA not central city"
label var totn_ncc_offenses_vc "ACT NUM # VIOLENT CRIME, MSA not central city"
label var totnpc_ncc_offenses_1c "ACT PC MURDER, MSA not central city per capita"
label var totnpc_ncc_offenses_2c "ACT PC MANSLGHTR, MSA not central city per capita"
label var totnpc_ncc_offenses_3c "ACT PC RAPE TOTL, MSA not central city per capita"
label var totnpc_ncc_offenses_4c "ACT PC FORC RAPE, MSA not central city per capita"
label var totnpc_ncc_offenses_5c "ACT  PC ATMPTD RAPE, MSA not central city per capita"
label var totnpc_ncc_offenses_6c "ACT  PC ROBBRY TOTL, MSA not central city per capita"
label var totnpc_ncc_offenses_7c "ACT  PC GUN ROBBERY, MSA not central city per capita"
label var totnpc_ncc_offenses_8c "ACT  PC KNIFE ROBRY, MSA not central city per capita"
label var totnpc_ncc_offenses_9c "ACT  PC OTH WPN ROB, MSA not central city per capita"
label var totnpc_ncc_offenses_10c "ACT  PC STR ARM ROB, MSA not central city per capita"
label var totnpc_ncc_offenses_11c "ACT  PC ASSLT TOTAL, MSA not central city per capita"
label var totnpc_ncc_offenses_12c "ACT  PC GUN ASSAULT, MSA not central city per capita"
label var totnpc_ncc_offenses_13c "ACT  PC KNIFE ASSLT, MSA not central city per capita"
label var totnpc_ncc_offenses_14c "ACT  OTH WPN ASSLT, MSA not central city per capita"
label var totnpc_ncc_offenses_15c "ACT  HND/FEET ASLT, MSA not central city per capita"
label var totnpc_ncc_offenses_16c "ACT PC SIMPLE ASSLT, MSA not central city per capita"
label var totnpc_ncc_offenses_17c "ACT PC BURGLARY TOTL, MSA not central city per capita"
label var totnpc_ncc_offenses_18c "ACT PC FORCE ENTRY, MSA not central city per capita"
label var totnpc_ncc_offenses_19c "ACT PC ENTRY-NO FORC, MSA not central city per capita"
label var totnpc_ncc_offenses_20c "ACT PC ATT BURGLARY, MSA not central city per capita"
label var totnpc_ncc_offenses_21c "ACT PC LARCENY TOTAL, MSA not central city per capita"
label var totnpc_ncc_offenses_22c "ACT PC VHC THEFT TOT, MSA not central city per capita"
label var totnpc_ncc_offenses_23c "ACT PC AUTO THEFT, MSA not central city per capita"
label var totnpc_ncc_offenses_24c "ACT PC TRCK/BUS THFT, MSA not central city per capita"
label var totnpc_ncc_offenses_25c "ACT PC OTH VHC THEFT, MSA not central city per capita"
label var totnpc_ncc_offenses_26c "ACT PC ALL FIELDS, MSA not central city per capita"
label var totnpc_ncc_offenses_ass "ACT PC AGGRAVATED ASSAULT, MSA not central city per capita"
label var totnpc_ncc_offenses_vc "ACT PC VIOLENT CRIME, MSA not central city per capita"
label var totnpcc_ncc_offenses_1c "ACT PC MURDER, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_2c "ACT PC MANSLGHTR, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_3c "ACT PC RAPE TOTL, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_4c "ACT PC FORC RAPE, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_5c "ACT  PC ATMPTD RAPE, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_6c "ACT  PC ROBBRY TOTL, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_7c "ACT  PC GUN ROBBERY, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_8c "ACT  PC KNIFE ROBRY, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_9c "ACT  PC OTH WPN ROB, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_10c "ACT  PC STR ARM ROB, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_11c "ACT  PC ASSLT TOTAL, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_12c "ACT  PC GUN ASSAULT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_13c "ACT  PC KNIFE ASSLT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_14c "ACT  OTH WPN ASSLT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_15c "ACT  HND/FEET ASLT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_16c "ACT PC SIMPLE ASSLT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_17c "ACT PC BURGLARY TOTL, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_18c "ACT PC FORCE ENTRY, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_19c "ACT PC ENTRY-NO FORC, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_20c "ACT PC ATT BURGLARY, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_21c "ACT PC LARCENY TOTAL, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_22c "ACT PC VHC THEFT TOT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_23c "ACT PC AUTO THEFT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_24c "ACT PC TRCK/BUS THFT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_25c "ACT PC OTH VHC THEFT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_26c "ACT PC ALL FIELDS, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_ass "ACT PC AGGRAVATED ASSAULT, MSA not central city per capita corrected"
label var totnpcc_ncc_offenses_vc "ACT PC VIOLENT CRIME, MSA not central city per capita corrected"
label var tot_ncc_oripop1 "Total MSA not central city population under ORI, using pop1"
label var tot_ncc_oripop "Total MSA not central city population under ORI, using pop1+pop2+pop3"
label var tot_ncc_oripop_corr "Total MSA not central city population under ORI, using pop1+pop2+pop3 corrected"
label var totn_cc_offenses_1c "ACT NUM MURDER, city center"
label var totn_cc_offenses_2c "ACT NUM MANSLGHTR, city center"
label var totn_cc_offenses_3c "ACT NUM RAPE TOTL, city center"
label var totn_cc_offenses_4c "ACT NUM FORC RAPE, city center"
label var totn_cc_offenses_5c "ACT NUM ATMPTD RAPE, city center"
label var totn_cc_offenses_6c "ACT NUM ROBBRY TOTL, city center"
label var totn_cc_offenses_7c "ACT NUM GUN ROBBERY, city center"
label var totn_cc_offenses_8c "ACT NUM KNIFE ROBRY, city center"
label var totn_cc_offenses_9c "ACT NUM OTH WPN ROB, city center"
label var totn_cc_offenses_10c "ACT NUM STR ARM ROB, city center"
label var totn_cc_offenses_11c "ACT NUM ASSLT TOTAL, city center"
label var totn_cc_offenses_12c "ACT NUM GUN ASSAULT, city center"
label var totn_cc_offenses_13c "ACT NUM KNIFE ASSLT, city center"
label var totn_cc_offenses_14c "ACT # OTH WPN ASSLT, city center"
label var totn_cc_offenses_15c "ACT # HND/FEET ASLT, city center"
label var totn_cc_offenses_16c "ACT NUM # SIMPLE ASSLT, city center"
label var totn_cc_offenses_17c "ACT NUM # BURGLARY TOTL, city center"
label var totn_cc_offenses_18c "ACT NUM # FORCE ENTRY, city center"
label var totn_cc_offenses_19c "ACT NUM # ENTRY-NO FORC, city center"
label var totn_cc_offenses_20c "ACT NUM # ATT BURGLARY, city center"
label var totn_cc_offenses_21c "ACT NUM # LARCENY TOTAL, city center"
label var totn_cc_offenses_22c "ACT NUM # VHC THEFT TOT, city center"
label var totn_cc_offenses_23c "ACT NUM # AUTO THEFT, city center"
label var totn_cc_offenses_24c "ACT NUM # TRCK/BUS THFT, city center"
label var totn_cc_offenses_25c "ACT NUM # OTH VHC THEFT, city center"
label var totn_cc_offenses_26c "ACT NUM # ALL FIELDS, city center"
label var totn_cc_offenses_ass "ACT NUM # AGGRAVATED ASSAULT, city center"
label var totn_cc_offenses_vc "ACT NUM # VIOLENT CRIME, city center"
label var totnpc_cc_offenses_1c "ACT PC MURDER, city center per capita"
label var totnpc_cc_offenses_2c "ACT PC MANSLGHTR, city center per capita"
label var totnpc_cc_offenses_3c "ACT PC RAPE TOTL, city center per capita"
label var totnpc_cc_offenses_4c "ACT PC FORC RAPE, city center per capita"
label var totnpc_cc_offenses_5c "ACT  PC ATMPTD RAPE, city center per capita"
label var totnpc_cc_offenses_6c "ACT  PC ROBBRY TOTL, city center per capita"
label var totnpc_cc_offenses_7c "ACT  PC GUN ROBBERY, city center per capita"
label var totnpc_cc_offenses_8c "ACT  PC KNIFE ROBRY, city center per capita"
label var totnpc_cc_offenses_9c "ACT  PC OTH WPN ROB, city center per capita"
label var totnpc_cc_offenses_10c "ACT  PC STR ARM ROB, city center per capita"
label var totnpc_cc_offenses_11c "ACT  PC ASSLT TOTAL, city center per capita"
label var totnpc_cc_offenses_12c "ACT  PC GUN ASSAULT, city center per capita"
label var totnpc_cc_offenses_13c "ACT  PC KNIFE ASSLT, city center per capita"
label var totnpc_cc_offenses_14c "ACT  OTH WPN ASSLT, city center per capita"
label var totnpc_cc_offenses_15c "ACT  HND/FEET ASLT, city center per capita"
label var totnpc_cc_offenses_16c "ACT PC SIMPLE ASSLT, city center per capita"
label var totnpc_cc_offenses_17c "ACT PC BURGLARY TOTL, city center per capita"
label var totnpc_cc_offenses_18c "ACT PC FORCE ENTRY, city center per capita"
label var totnpc_cc_offenses_19c "ACT PC ENTRY-NO FORC, city center per capita"
label var totnpc_cc_offenses_20c "ACT PC ATT BURGLARY, city center per capita"
label var totnpc_cc_offenses_21c "ACT PC LARCENY TOTAL, city center per capita"
label var totnpc_cc_offenses_22c "ACT PC VHC THEFT TOT, city center per capita"
label var totnpc_cc_offenses_23c "ACT PC AUTO THEFT, city center per capita"
label var totnpc_cc_offenses_24c "ACT PC TRCK/BUS THFT, city center per capita"
label var totnpc_cc_offenses_25c "ACT PC OTH VHC THEFT, city center per capita"
label var totnpc_cc_offenses_26c "ACT PC ALL FIELDS, city center per capita"
label var totnpc_cc_offenses_ass "ACT PC AGGRAVATED ASSAULT, city center per capita"
label var totnpc_cc_offenses_vc "ACT PC VIOLENT CRIME, city center per capita"
label var totnpcc_cc_offenses_1c "ACT PC MURDER, city center per capita corrected"
label var totnpcc_cc_offenses_2c "ACT PC MANSLGHTR, city center per capita corrected"
label var totnpcc_cc_offenses_3c "ACT PC RAPE TOTL, city center per capita corrected"
label var totnpcc_cc_offenses_4c "ACT PC FORC RAPE, city center per capita corrected"
label var totnpcc_cc_offenses_5c "ACT  PC ATMPTD RAPE, city center per capita corrected"
label var totnpcc_cc_offenses_6c "ACT  PC ROBBRY TOTL, city center per capita corrected"
label var totnpcc_cc_offenses_7c "ACT  PC GUN ROBBERY, city center per capita corrected"
label var totnpcc_cc_offenses_8c "ACT  PC KNIFE ROBRY, city center per capita corrected"
label var totnpcc_cc_offenses_9c "ACT  PC OTH WPN ROB, city center per capita corrected"
label var totnpcc_cc_offenses_10c "ACT  PC STR ARM ROB, city center per capita corrected"
label var totnpcc_cc_offenses_11c "ACT  PC ASSLT TOTAL, city center per capita corrected"
label var totnpcc_cc_offenses_12c "ACT  PC GUN ASSAULT, city center per capita corrected"
label var totnpcc_cc_offenses_13c "ACT  PC KNIFE ASSLT, city center per capita corrected"
label var totnpcc_cc_offenses_14c "ACT  OTH WPN ASSLT, city center per capita corrected"
label var totnpcc_cc_offenses_15c "ACT  HND/FEET ASLT, city center per capita corrected"
label var totnpcc_cc_offenses_16c "ACT PC SIMPLE ASSLT, city center per capita corrected"
label var totnpcc_cc_offenses_17c "ACT PC BURGLARY TOTL, city center per capita corrected"
label var totnpcc_cc_offenses_18c "ACT PC FORCE ENTRY, city center per capita corrected"
label var totnpcc_cc_offenses_19c "ACT PC ENTRY-NO FORC, city center per capita corrected"
label var totnpcc_cc_offenses_20c "ACT PC ATT BURGLARY, city center per capita corrected"
label var totnpcc_cc_offenses_21c "ACT PC LARCENY TOTAL, city center per capita corrected"
label var totnpcc_cc_offenses_22c "ACT PC VHC THEFT TOT, city center per capita corrected"
label var totnpcc_cc_offenses_23c "ACT PC AUTO THEFT, city center per capita corrected"
label var totnpcc_cc_offenses_24c "ACT PC TRCK/BUS THFT, city center per capita corrected"
label var totnpcc_cc_offenses_25c "ACT PC OTH VHC THEFT, city center per capita corrected"
label var totnpcc_cc_offenses_26c "ACT PC ALL FIELDS, city center per capita corrected"
label var totnpcc_cc_offenses_ass "ACT PC AGGRAVATED ASSAULT, city center per capita corrected"
label var totnpcc_cc_offenses_vc "ACT PC VIOLENT CRIME, city center per capita corrected"
label var tot_cc_oripop1 "Total city center population under ORI, using pop1"
label var tot_cc_oripop "Total city center population under ORI, using pop1+pop2+pop3"
label var tot_cc_oripop_corr "Total city center population under ORI, using pop1+pop2+pop3 corrected"
label var fipsplace_00 "FIPS place code 2000"
label var tot_ncc_sdcc_oripop_corr "Total MSA not central city population sharing one school district with CC under ORI, using pop1+pop2+pop3 corrected"
label var tot_ncc_nosdcc_oripop_corr "Total MSA not central city population not sharing one school district with CC under ORI, using pop1+pop2+pop3 corrected"
label var tot_ncc_allsdcc_oripop_corr "Total MSA not central city population sharing all school districts with CC under ORI, using pop1+pop2+pop3 corrected"

///Keep only actual offenses
keep *_offenses_* *_oripop* year fipsplace_00 FMSA

*Rename pop CC
rename tot_cc_oripop_corr tot_cc_sd_oripop_corr
rename tot_ncc_oripop_corr tot_ncc_sd_oripop_corr
*Keep only population CC and NCC
keep tot_cc_sd_oripop_corr tot_ncc_sd_oripop_corr ///
     tot_ncc_sdcc_oripop_corr tot_ncc_nosdcc_oripop_corr ///
	 tot_ncc_allsdcc_oripop_corr year fipsplace_00 FMSA
 
save rawdata\schooldistrict\data_ucr_plc_sd.dta, replace

